
import java.io.Serializable;
import de.gulden.util.javasource.jjt.ParseException;
import java.rmi.*;
import java.util.*;
import org.dea.mapping.*;

public class SwitchSimple implements Serializable
{    Map distributedComponentsList = null;

    public SwitchSimple() throws RemoteException, Exception {

        	distributedComponentsList = EasyAcceptMappingReader.processMappingFile( "test/xml/onlyAlpha.xml");

    }

    public void simmmmmple(String switchID) throws ParseException, RemoteException, RemoteException {
        getFacade(switchID).simmmmmple();
    }

    private IFSimple getFacade(String switchID) {
        DistributedComponent cpm = (DistributedComponent) distributedComponentsList.get( "switchID" );
        String hostAddress = cpm.getHostAddress() + ":" + cpm.getHostPort();
        IFSimple obj = null;
        try{
        	obj = (IFSimple)
        	Naming.lookup("rmi://"+ hostAddress +"/IFSimple");
        } catch (Exception ex){
        	ex.printStackTrace();
        }

        return obj;

    }

} // end SwitchSimple
